//
//  MyInquiryController.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/2/28.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

class MyInquiryController: BaseViewController {
    
    private let status: Int
    private let startIndex: Int
    
    init(with status: Int, startIndex: Int = 0) {
        self.status = status
        self.startIndex = startIndex
        super.init(nibName: nil, bundle: nil)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "我的问诊"
        setupPageStyle()
    }

    private func setupPageStyle() {
        var style = PageViewStyle()
        style.isTitleScaleEnabled = true
        style.titleSelectedColor = .mainColor
        style.titleNormalColor = .textDark
        style.isContentViewScrollEnabled = true
        style.titleFont = .medium(16)
        
        let titles = ["云门诊", "图文咨询"]
        let cloudVc = MyCloudController(with: status)
        let advisoryVc = MyAdvisoryController(with: status)
        let vcs = [cloudVc, advisoryVc]
        for vc in vcs {
            self.addChild(vc)
        }
        let rect = CGRect(x: 0, y: navBarH, width: screenW, height: screenH - navBarH)
        let pageView = PageView(frame: rect,
                                style: style,
                                titles: titles,
                                childViewControllers: vcs,
                                startIndex: startIndex)
        view.addSubview(pageView)
    }
}
